﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MDF.DataHelper.DataObject.NewsDO;
using MDF.DataHelper.BussinessObject.NewsBO;
using System.Data;
using MDF.Utilites.Tools;

namespace MDF.DataHelper.BussinessLogic.NewsBL
{
    public class EmailReciveBUS : BaseBussinessLogic
    {
        #region staticMember
        /// <summary>
        /// 
        /// </summary>
        private static EmailReciveBUS _instance;
        /// <summary>
        /// 
        /// </summary>
        public static EmailReciveBUS Current
        {
            get { return _instance == null ? _instance = new EmailReciveBUS() : _instance; }
        }
        #endregion

        public bool Insert(string _strEmail)
        {
            EmailReciveDAO objEmail = new EmailReciveDAO(this.m_objData);
            objEmail.Insert(_strEmail);
            return true;
        }

        public List<EmailRecive> GetAll(int _iPage, int _iPageSize)
        {
            DataTable dt = new DataTable();
            EmailReciveDAO objNewsDAO = new EmailReciveDAO(this.m_objData);
            dt = objNewsDAO.GetAll(_iPage, _iPageSize);
            var lstTemp = dt.ToList<EmailRecive>();
            return lstTemp;
        }

        public bool Delete(string _strEmail)
        {
            EmailReciveDAO objEmail = new EmailReciveDAO(this.m_objData);
            objEmail.Delete(_strEmail);
            return true;
        }
    }
}
